package com.elcom.roaming.test;

import java.util.Random;

import com.elcom.ipc_as_smpp.pdu.IPCData;

public class Bot {
	
	long pickTime = 1;
	int sendMess = 10;
	
	public String genNumber() {
		String number = "8490";
		int k = new Random().nextInt(5000000) + 1;
		int i = k;
		
		while (i<1000000) {
			number += "0";
			i*=10;
		}
		
		number += Integer.toString(k);
		return number;
	}
	
	public void send() {
		BalancingClient bc = new BalancingClient("192.168.6.110", 7208);

		if (!bc.connect()) {
			System.out.println("connection fail");
			return;
		}

		IPCData mc = new IPCData();
		mc.setSequenceNumber(123);
		mc.setBody("Hellp|12345".getBytes());
		
		bc.write(mc.getDataAsBytes());
		
	}

	public static void main(String[] args) {

//		 for (int i=0; i<10; i++) new Thread(new Bot()).start();

		 new Bot().send();

		// new Bot().send();

//		 new Bot().send();

		
		
	}

}
